
require('./config/mongodb')()

// var bookModel = require('./models/bookModel')

// bookModel.find({},function(err,items){

//     console.log(items);
// })

var categoryModel = require('./models/categoryModel')

var fs = require('fs')

var str = fs.readFileSync('./category.json')

var arr = JSON.parse(str)

arr.forEach(element => {
    new categoryModel(element).save(function(err,item){

        console.log(item);
    });
});
